import { Utils } from './Utils'

export class HttpMethod {
  //Request method
  static OPTIONS = HttpMethod.create("OPTIONS")
  static GET = HttpMethod.create("GET")
  static HEAD = HttpMethod.create("HEAD")
  static POST = HttpMethod.create("POST")
  static PUT = HttpMethod.create("PUT")
  static DELETE = HttpMethod.create("DELETE")
  static TRACE = HttpMethod.create("TRACE")
  static CONNECT = HttpMethod.create("CONNECT")

  constructor(public method: string) {
  }

  static create(method?: string): HttpMethod {
    if (Utils.isEmpty(method)) {
      return HttpMethod.GET
    }
    return new HttpMethod(method)
  }
}


